<include file="public@header"/>
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li ><a href="{:url('AdminGoodSpec/index')}">商品规格列表</a></li>
        <li ><a href="{:url('AdminGoodSpec/add')}">添加商品规格</a></li>
        <li class="active"><a href="{:url('AdminGoodSpec/edit',array('id'=>$data['id']))}">编辑商品规格</a></li>
    </ul>

    <form method="post" class="form-horizontal js-ajax-form margin-top-20" action="{:url('AdminGoodSpec/editPost')}">
        <div class="form-group">
            <label class="col-sm-2 control-label"><span class="form-required">*</span>规格名称:</label>
            <div class="col-md-6 col-sm-10">
                <input type="text" class="form-control" name="spec_name" required value="{$data.spec_name}">
                <input type="hidden" class="form-control" name="id" value="{$data.id}">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">所属商品类型:</label>
            <div class="col-md-6 col-sm-10">
                <select name="type_id" class="form-control goods_type">
                    <option value="0">请选择</option>
                    <foreach name="typelist" item="vo">
                        <option value="{$vo.id}" <if condition="$data['type_id'] eq $vo['id']">selected</if>>{$vo.name}</option>
                    </foreach>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">可选规格:</label>
            <div class="col-md-6 col-sm-10">
                <textarea name="item"  cols="30" rows="5" required >{$items}</textarea><span class="form-required"> *一行代表一个值</span>
            </div>
        </div>


        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <button type="submit" class="btn btn-primary js-ajax-submit">{:lang('ADD')}</button>
                <a class="btn btn-default" href="{:url('AdminGoodSpec/index')}">{:lang('BACK')}</a>
            </div>
        </div>
    </form>

</div>
<script src="__STATIC__/js/admin.js"></script>
</body>
</html>